﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using BusinessLayer.Tables;

/// <summary>
/// Summary description for MasterPage
/// </summary>
public class MasterPage : Page
{
    public MasterPage()
    {

    }
    protected override void OnPreInit(EventArgs e)
    {
        if (Session["UserKod"] == null || Session["UserRandomId"] == null)
        {
            Response.Redirect("Login.aspx");
        }
        else
        {
            Db_Users usr = new Db_Users();
            string kod = Session["UserKod"].ToString();
            usr.UserKod = kod;
            usr.KayitBul();
            if (usr.UserPrgId != Session["UserRandomId"].ToString())
            {
                Response.Redirect("Login.aspx");
            }
        }

        this.Theme = "vista";
        base.OnPreInit(e);
    }
}
